package com.bagus.mediapipefacedetection.module.detect;


import com.bagus.mediapipefacedetection.manager.DetectQualityManager;
import com.bagus.mediapipefacedetection.manager.FaceDetectManager;
import com.bagus.mediapipefacedetection.module.base.BaseModel;
import com.bagus.mediapipefacedetection.quality.DetectQualityInfo;
import com.bagus.mediapipefacedetection.quality.DetectQualityStatus;
import com.google.mediapipe.formats.proto.LandmarkProto;

import java.util.List;

public class DetectModel extends BaseModel implements DetectContract.Model {
//    @Override
//    public boolean init(byte[] trackModel, byte[] mouthModel, byte[] eyeModel, byte[] poseModel, byte[] blurModel) {
//        return FaceDetectManager.getInstance().init(trackModel, mouthModel, eyeModel, poseModel, blurModel);
//    }
//
//    @Override
//    public DetectQualityInfo detect(int imageMode, byte[] yuvImageData, int imageWidth, int imageHeight, int angle) {
//        return FaceDetectManager.getInstance().detect(imageMode, yuvImageData, imageWidth, imageHeight, angle);
//    }

    @Override
    public DetectQualityInfo detect(int imageMode, List<LandmarkProto.NormalizedLandmark> landmarks, int imageWidth, int imageHeight) {
        return FaceDetectManager.getInstance().detect(imageMode,landmarks,imageWidth,imageHeight);
    }

    @Override
    public void release() {
//        FaceDetectManager.getInstance().release();
    }

    @Override
    public void startDetect() {
//        FaceDetectManager.getInstance().startDetect();
    }

    @Override
    public void stopDetect() {
        FaceDetectManager.getInstance().stopDetect();
    }

    @Override
    public void reset() {
//        FaceDetectManager.getInstance().reset();
    }

    @Override
    public DetectQualityStatus getQualityStatus(DetectQualityInfo info) {
        return DetectQualityManager.getInstance().getDetectQualityStatusStable(info);
    }

    @Override
    public DetectQualityManager getQualityManager() {
        return DetectQualityManager.getInstance();
    }
}
